# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

    def forwards(self, orm):
        # Adding index on 'NewsDetail', fields ['date', 'add_succeeded']
        db.create_index(u'news_newsdetail', ['date', 'add_succeeded'])


    def backwards(self, orm):
        # Removing index on 'NewsDetail', fields ['date', 'add_succeeded']
        db.delete_index(u'news_newsdetail', ['date', 'add_succeeded'])


    models = {
        u'basic_info.stock': {
            'Meta': {'object_name': 'Stock'},
            'code': ('django.db.models.fields.CharField', [], {'max_length': '8', 'primary_key': 'True'}),
            'csrc_industry': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
            'csrc_sub_industry': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'full_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
            'pinyin_name': ('django.db.models.fields.CharField', [], {'max_length': '20'}),
            'short_name': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
        },
        u'news.clustersummary': {
            'Meta': {'unique_together': "(('daily_summary', 'cluster_id'),)", 'object_name': 'ClusterSummary'},
            'cluster_id': ('django.db.models.fields.IntegerField', [], {}),
            'daily_summary': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['news.DailySummary']"}),
            'display_news': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['news.NewsDetail']"}),
            'doc_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'keywords': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'negative_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'neutral_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'positive_count': ('django.db.models.fields.IntegerField', [], {'default': '0'})
        },
        u'news.dailysummary': {
            'Meta': {'unique_together': "(('date', 'category', 'edition'),)", 'object_name': 'DailySummary'},
            'category': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
            'date': ('django.db.models.fields.DateField', [], {}),
            'doc_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'domain_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'edition': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'negative_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'neutral_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'positive_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'top_keywords': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'})
        },
        u'news.newsclusters': {
            'Meta': {'unique_together': "(('news', 'edition', 'cluster_id'),)", 'object_name': 'NewsClusters'},
            'cluster_id': ('django.db.models.fields.IntegerField', [], {}),
            'edition': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'news': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['news.NewsDetail']"})
        },
        u'news.newsdetail': {
            'Meta': {'unique_together': "(('date', 'category', 'url_hash'),)", 'object_name': 'NewsDetail', 'index_together': "[['date', 'category'], ['date', 'add_succeeded']]"},
            'add_succeeded': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'category': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
            'date': ('django.db.models.fields.DateField', [], {'db_index': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'keywords': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'polarity': ('django.db.models.fields.IntegerField', [], {'default': '-1'}),
            'published_time': ('django.db.models.fields.DateTimeField', [], {}),
            'publisher': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'related_stocks': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['basic_info.Stock']", 'through': u"orm['news.NewsStocksMap']", 'symmetrical': 'False'}),
            'static_summary': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
            'url_hash': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'})
        },
        u'news.newsstocksmap': {
            'Meta': {'unique_together': "(('news', 'stock'),)", 'object_name': 'NewsStocksMap'},
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'news': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['news.NewsDetail']"}),
            'stock': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['basic_info.Stock']"})
        },
        u'news.stocksummary': {
            'Meta': {'unique_together': "(('stock', 'date', 'edition'),)", 'object_name': 'StockSummary'},
            'date': ('django.db.models.fields.DateField', [], {}),
            'doc_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'edition': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'negative_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'neutral_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'positive_count': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'stock': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['basic_info.Stock']"})
        }
    }

    complete_apps = ['news']